package com.demo.swingquickticket.entity;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;

@Data
@ToString
public class TicketDetail implements Serializable {

    //列车号（购票需要传递参数三）
    private String trainNo;

    //站台列车号
    private String stationTrainCode;

    //起始站代码
    private String startStationTeleCode;

    //终点站代码
    private String endStationTeleCode;

    //途中开始站代码（购票需要传递参数四）
    private String fromStationTeleCode;

    //途中目标站代码（购票需要传递参数五）
    private String toStationTeleCode;

    //开始站开车时间（购票需要传递参数二）
    private String startTime;

    //目标站到达时间
    private String arriveTime;

    //耗时
    private String liShi;

    //是否能在网上购买(Y,N)
    private String canWebBuy;

    //余票信息leftTicket
    private String ypInfo;

    //列车起始日期（yyyyMMdd）
    private String startTrainDate;

    //
    private String trainSeatFeature;

    //
    private String locationCode;

    //开始站站台号
    private String fromStationNo;

    //目标站站台号
    private String toStationNo;

    //是否支持刷卡
    private String isSupportCard;

    //是否为受控列车(0不是)
    private String controlledTrainFlag;

    private String ggNum;

    //高级软卧(6)
    private String grNum;

    //其他(1)
    private String qtNum;

    //软卧(4)
    private String rwNum;

    //软座(2)
    private String rzNum;

    //特等座（和商务座一起出现）(9)
    private String tzNum;

    //无座(1)
    private String wzNum;

    //
    private String ybNum;

    //硬卧(3)
    private String ywNum;

    //硬座(1)
    private String yzNum;

    //二等座(O)
    private String zeNum;

    //一等座(M)
    private String zyNum;

    //商务座(9)
    private String swzNum;

    //动卧(F)
    private String srrbNum;

    private String ypEx;

    //座位类型
    private String seatTypes;

    private String exchangeTrainFlag;

    private String houbuTrainFlag;

    private String houbuSeatLimit;

    //出发站中文名
    private String fromStationName;

    //目标站中文名
    private String toStationName;

    public TicketDetail(String[] data, JSONObject map) {
        this.trainNo = data[2];
        this.stationTrainCode = data[3];
        this.startStationTeleCode = data[4];
        this.endStationTeleCode = data[5];
        this.fromStationTeleCode = data[6];
        this.toStationTeleCode = data[7];
        this.startTime = data[8];
        this.arriveTime = data[9];
        this.liShi = data[10];
        this.canWebBuy = data[11];
        this.ypInfo = data[12];
        this.startTrainDate = data[13];
        this.trainSeatFeature = data[14];
        this.locationCode = data[15];
        this.fromStationNo = data[16];
        this.toStationNo = data[17];
        this.isSupportCard = data[18];
        this.controlledTrainFlag = data[19];
        this.ggNum = data[20];
        this.grNum = data[21];
        this.qtNum = data[22];
        this.rwNum = data[23];
        this.rzNum = data[24];
        this.tzNum = data[25];
        this.wzNum = data[26];
        this.ybNum = data[27];
        this.ywNum = data[28];
        this.yzNum = data[29];
        this.zeNum = data[30];
        this.zyNum = data[31];
        this.swzNum = data[32];
        this.srrbNum = data[33];
        this.ypEx = data[34];
        this.seatTypes = data[35];
        this.exchangeTrainFlag = data[36];
        this.houbuTrainFlag = data[37];
        if (data.length > 38) {
            this.houbuSeatLimit = data[38];
        }
        this.fromStationName = map.getString(data[6]);
        this.toStationName = map.getString(data[7]);
    }
}
